package com.example.test_system.service;

import com.example.test_system.mapper.QuestionMapper;
import com.example.test_system.model.Judge;
import com.example.test_system.model.MultipleChoice;
import com.example.test_system.model.SingleChoice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionService {

    @Autowired
    QuestionMapper questionMapper;

    public void addJudge(Judge judge){
        questionMapper.addJudge(judge);
    }

    public void addSingleChoice(SingleChoice singleChoice){
        questionMapper.addSingleChoice(singleChoice);
    }

    public void addMultipleChoice(MultipleChoice multipleChoice){
        questionMapper.addMultipleChoice(multipleChoice);
    }

    public List<Judge> listJudge(int page, int size) {
        return questionMapper.listJudge(page, size);
    }

    public List<SingleChoice> listSingleChoice(int page, int size) {
        return questionMapper.listSingleChoice(page, size);
    }

    public List<MultipleChoice> listMultipleChoice(int page, int size) {
        return questionMapper.listMultipleChoice(page, size);
    }

    public void deleteJudgeById(int id){
        questionMapper.deleteJudgeById(id);
    }

    public void deleteSingleChoiceById(int id){
        questionMapper.deleteSingleChoiceById(id);
    }

    public void deleteMultipleChoiceById(int id){
        questionMapper.deleteMultipleChoiceById(id);
    }
}
